\name{ct_table}
\alias{ct_table}
\title{
Convert crosstabs to tables
}
\description{
This functions converts a crosstab to a table and returns it as a data frame. You may supply your crosstab as a data frame or as a matrix.
}
\usage{
ct_table(data, type = c('total', 'home', 'away'), separator = '-')
}
\arguments{
  \item{data}{
a valid crosstab provided as a data frame or as a matrix
}
  \item{type}{
\sQuote{total} by default, \sQuote{home} or \sQuote{away}
}
  \item{separator}{
character string that separates goals of the home and the away team in the crosstab
}
}
\details{
The following abbreviations are used in the resulting table:
  \describe{
    \item{\code{CLUB}}{club name}
    \item{\code{P}}{matches played}
    \item{\code{PT}}{maximum matches per season}
    \item{\code{W}}{wins}
    \item{\code{D}}{draws}
    \item{\code{L}}{losses}
    \item{\code{GF}}{goals scored for}
    \item{\code{GA}}{goals scored against}
    \item{\code{GD}}{goal difference}
    \item{\code{PTS}}{points}
    \item{\code{PTF}}{point difference to first}
    \item{\code{PTL}}{point difference to last}
  }
}
\examples{
# Load and check the crosstab

data(bundesliga_12_13)
ct_check(bundesliga_12_13)

# Calculate a table from the crosstab

res <- ct_table(bundesliga_12_13)

# Visualize the result

ct_p_ellipse(res)
ct_p_table(res)
}
\keyword{ misc }
